package com.java.star.mall.front.pojo.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 修改购物项数量参数
 */
@Data
public class UpdateCartNumParam implements Serializable {

    private static final long serialVersionUID = -5547668513173160891L;

    @ApiModelProperty(value = "商品id", required = true)
    @NotNull(message = "商品id不能为空")
    private Integer productId;

    @ApiModelProperty(value = "商品数量", required = true)
    @NotNull(message = "商品数量不能为空")
    private Integer num;

    @ApiModelProperty(value = "操作方式", required = true)
    @NotEmpty(message = "操作方式不能为空")
    @Pattern(regexp = "^(add|decrease)$", message = "操作方式的值不合法")
    private String operation;
}
